﻿using System;
using UnityEngine;

namespace CGF
{
    public class MonoLifeListener : MonoBehaviour
    {
        public event Action onEnable;
        public event Action onDisable;
        public event Action onDestroy;

        private void OnEnable()
        {
            onEnable?.Invoke();
        }

        private void OnDisable()
        {
            onDisable?.Invoke();
        }

        public void OnDestroy()
        {
            onDestroy?.Invoke();
        }

    }
}